<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
    <div class="container">
        <a class="navbar-brand" href="/">Steam游戏商城</a>
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarNav">
            <ul class="navbar-nav mr-auto">
                <li class="nav-item">
                    <a class="nav-link" href="/">首页</a>
                </li>
                <li class="nav-item">
<!--                    <a class="nav-link" href="/games">游戏列表</a>-->
                </li>
            </ul>
            <ul class="navbar-nav">
                <li class="nav-item">
                    <a class="nav-link" th:href="@{/cart}">购物车</a>
                </li>
                <li class="nav-item" th:if="${session.userId == null}">
                    <a class="nav-link" th:href="@{/login}">登录</a>
                </li>
                <li class="nav-item" th:if="${session.userId == null}">
                    <a class="nav-link" th:href="@{/register}">注册</a>
                </li>
                <li class="nav-item" th:if="${session.userId != null}">
                    <a class="nav-link" th:href="@{/orders}">我的订单</a>
                </li>
                <li class="nav-item" th:if="${session.userId != null}">
                    <a class="nav-link" th:href="@{/logout}">退出登录</a>
                </li>
            </ul>
        </div>
    </div>
</nav>

<!-- 确保样式在 head 中 -->
<style>
    body {
        padding-top: 70px; /* 增加到 70px 以确保足够空间 */
    }
    .navbar-brand {
        font-weight: bold;
    }
</style>